#pragma once 
#include <iostream>
using namespace std;

//松灵小车包括 底盘、AGX套件、双目摄像头、多线激光雷达、9轴陀螺仪、液晶显示屏、电池模块这几个大类
#include "Underpan.h"
#include "AGX.h"
#include "Camera.h"
#include "Lidar.h"
#include "Gyroscoup.h"
#include "Green.h"
#include "Battery.h"

class Car
{
public:
  string id;           // （1）编号：自定义，cqusn打头的16位数字+字母
  Underpan underpan;   // （2）底盘
  AGX agx;             // （3）AGX套件
  Camera camera;       // （4）双目摄像头
  Lidar lidar;         // （5）多线激光雷达
  Gyroscope gyroscope; // （6）9轴陀螺仪
  Green green;         // （7）液晶显示屏
  Battery battery;     // （8）电池模块


 // 默认构造函数
  Car() : id(""), underpan(Underpan()), agx(AGX()), camera(Camera()),
           lidar(Lidar()), gyroscope(Gyroscope()), green(Green()), battery(Battery()) {}

  // 构造函数
  Car(string id, Underpan u, AGX a, Camera c, Lidar l,
      Gyroscope g, Green gn, Battery b)
      : id(id), underpan(u), agx(a), camera(c), lidar(l),
        gyroscope(g), green(gn), battery(b) {}

  // 打印单个小车的信息
  void printCarDetails()
  {
    cout << "小车编号: " << this->id << endl;
    cout << "底盘编号: " << this->underpan.id << endl;
    cout << "底盘型号: " << this->underpan.model << endl;
    cout << "轴距: " << this->underpan.wheelbase << "mm" << endl;
    cout << "轮距: " << this->underpan.track_width << "mm" << endl;
    cout << "最小离地间隙: " << this->underpan.ground_clearance << "mm" << endl;
    cout << "最小转弯半径: " << this->underpan.turning_radius << "m" << endl;
    cout << "驱动形式: " << this->underpan.drive_form << endl;
    cout << "最大行程: " << this->underpan.max_range << "KM" << endl;
    for (const auto &tire : this->underpan.tires)
    {
      cout << "轮胎型号: " << tire.type << ", 尺寸: " << tire.size << endl;
    }
    cout << "AGX套件型号: " << this->agx.model << endl;
    cout << "AI性能: " << this->agx.aiPerformance << " TOPS" << endl;
    cout << "CUDA核心数: " << this->agx.cudaCores << endl;
    cout << "Tensor核心数: " << this->agx.tensorCores << endl;
    cout << "显存: " << this->agx.memory << "GB" << endl;
    cout << "存储: " << this->agx.storage << "GB" << endl;
    cout << "双目摄像头型号: " << this->camera.model << endl;
    cout << "RGB分辨率: " << this->camera.rgbResolutionWidth << "x" << this->camera.rgbResolutionHeight << endl;
    cout << "RGB帧率: " << this->camera.rgbFrameRate << "fps" << endl;
    cout << "视场角: " << this->camera.fovHorizontal << "x" << this->camera.fovVertical << endl;
    cout << "深度帧率: " << this->camera.depthFrameRate << "fps" << endl;
    cout << "多线激光雷达型号: " << this->lidar.model << endl;
    cout << "通道数: " << this->lidar.channels << endl;
    cout << "测试范围: " << this->lidar.range << "m" << endl;
    cout << "功耗: " << this->lidar.power << "W" << endl;
    cout << "9轴陀螺仪型号: " << this->gyroscope.model << ", 厂家: " << this->gyroscope.manufacturer << endl;
    cout << "液晶显示屏尺寸: " << this->green.size << "英寸" << endl;
    cout << "液晶显示屏型号: " << this->green.model << endl;
    cout << "电池电压: " << this->battery.voltage << "V" << endl;
    cout << "电池容量: " << this->battery.capacity << endl;
    cout << "对外供电电压: " << this->battery.supplyVoltage << "V" << endl;
    cout << "充电时长: " << this->battery.chargingTime << "小时" << endl;
    cout << "----------------------------------------" << endl;
  }
};